/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sk.smitala.gephi.scanclustering;

/**
 *
 * @author smitalm
 */
public class ScanClustererPanel extends javax.swing.JPanel {

    /**
     * Creates new form ScanClustererPanel
     */
    public ScanClustererPanel() {
	initComponents();
    }

    /**
     * Add here setters and getters for all properties users can edit.
     */
    public void setEpsilon(double epsilon) {
	this.epsilon.setText(epsilon + "");
    }

    public double getEpsilon() {
	try {
	    return Double.parseDouble(this.epsilon.getText());
	} catch (NumberFormatException e) {
	    e.printStackTrace(System.err);
	    return ScanClusterer.EPSILON_DEFAULT;
	}
    }

    public void setMu(int mu) {
	this.mu.setText(mu + "");
    }

    public int getMu() {
	try {
	    return Integer.parseInt(this.mu.getText());
	} catch (NumberFormatException e) {
	    e.printStackTrace(System.err);
	    return ScanClusterer.MU_DEFAULT;
	}
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        epsilonLabel = new javax.swing.JLabel();
        muLabel = new javax.swing.JLabel();
        epsilon = new javax.swing.JTextField();
        mu = new javax.swing.JTextField();
        epsilonDescription = new javax.swing.JLabel();
        muDescription = new javax.swing.JLabel();
        algorithmParams = new javax.swing.JLabel();

        epsilonLabel.setFont(new java.awt.Font("Tahoma", 2, 11)); // NOI18N
        org.openide.awt.Mnemonics.setLocalizedText(epsilonLabel, org.openide.util.NbBundle.getMessage(ScanClustererPanel.class, "ScanClustererPanel.epsilonLabel.text")); // NOI18N

        muLabel.setFont(new java.awt.Font("Tahoma", 2, 11)); // NOI18N
        org.openide.awt.Mnemonics.setLocalizedText(muLabel, org.openide.util.NbBundle.getMessage(ScanClustererPanel.class, "ScanClustererPanel.muLabel.text")); // NOI18N

        epsilon.setText(org.openide.util.NbBundle.getMessage(ScanClustererPanel.class, "ScanClustererPanel.epsilon.text")); // NOI18N

        mu.setText(org.openide.util.NbBundle.getMessage(ScanClustererPanel.class, "ScanClustererPanel.mu.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(epsilonDescription, org.openide.util.NbBundle.getMessage(ScanClustererPanel.class, "ScanClustererPanel.epsilonDescription.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(muDescription, org.openide.util.NbBundle.getMessage(ScanClustererPanel.class, "ScanClustererPanel.muDescription.text")); // NOI18N

        algorithmParams.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        org.openide.awt.Mnemonics.setLocalizedText(algorithmParams, org.openide.util.NbBundle.getMessage(ScanClustererPanel.class, "ScanClustererPanel.algorithmParams.text")); // NOI18N

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(25, 25, 25)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(muLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(epsilonLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(mu, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(muDescription))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(epsilon, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(epsilonDescription)))
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(algorithmParams, javax.swing.GroupLayout.PREFERRED_SIZE, 368, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(14, 14, 14)
                .addComponent(algorithmParams)
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(epsilonLabel)
                    .addComponent(epsilon, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(epsilonDescription))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(muLabel)
                    .addComponent(mu, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(muDescription))
                .addContainerGap(30, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel algorithmParams;
    private javax.swing.JTextField epsilon;
    private javax.swing.JLabel epsilonDescription;
    private javax.swing.JLabel epsilonLabel;
    private javax.swing.JTextField mu;
    private javax.swing.JLabel muDescription;
    private javax.swing.JLabel muLabel;
    // End of variables declaration//GEN-END:variables
}
